﻿--获取入职员工信息
CREATE proc [dbo].[proc_Employee_Entry_GetItem]

(
	@id int,
	@GID uniqueidentifier
)
as
	select 
		id,
		eid,
		(select ENumber from Employee E where EId=E.Id) as ENumber,
		(select ETempNumber from Employee E where EId=E.Id) as ETempNumber,
		(select EName from Employee E where EId=E.Id) as EName,
		(select Sex from Employee E where EId=E.Id) as Sex,
		(select IDCard from Employee E where EId=E.Id) as IDCard,
		(select CompanyId from Employee E where EId=E.Id) as CompanyId,
		(select CompanyName from Company where id=(select companyid from employee E where EId=E.Id)) as CompanyName,
		TDepartmentId as DepartmentId,
		(select DName from Department where id=TDepartmentId) as DName,
		TPCompanyId as PCompanyId,
		ISNULL(TPostCategory,0) as PostCategory,
		TPostId as PostId,
		(select PostName from Post where id=TPostId) as PostName,
		ISNULL((select title from Post_Category where id = TPostCategory),'...') as PostCategoryName,
		TGradeId as GradeId,
		(select Title from Grade where id=TGradeId) as GradeName,
		TPluralist as Pluralist,
		TRtx as Rtx,
		TRuzhiDate as RuzhiDate,
		TWageNumber as WageNumber,
		TWageCardNo as WageCardNo,
		TEnumber as Enumber,
		TProbationFrom,
		TProbationTo,
		AuditTime,
		TZhiWu AS ZhiWu,
		IsCore,
		isnull(TXZJB,'') AS TXZJB
		--(select ZhiWu from Employee E where EId=E.Id) as ZhiWu
	from
		employee_entry
	where
		id=@id and GID=@GID